package com.woniuxy.caradmin.service.impl;

import com.woniuxy.caradmin.entity.pojo.Yearcheckrecord;
import com.woniuxy.caradmin.entity.vo.YearcheckrecordVo;
import com.woniuxy.caradmin.mapper.YearcheckrecordMapper;
import com.woniuxy.caradmin.service.YearcheckrecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author womenzu
 * @since 2020-12-07
 */
@Service
public class YearcheckrecordServiceImpl  implements YearcheckrecordService {
    @Autowired
    private YearcheckrecordMapper yearcheckrecordMapper;
    @Override
    public List<Yearcheckrecord> selectAllByPage(YearcheckrecordVo yearcheckrecordVo) {
        return yearcheckrecordMapper.selectAllByPage(yearcheckrecordVo);
    }

    @Override
    public int addYearcheckrecord(Yearcheckrecord yearcheckrecord) {
        return yearcheckrecordMapper.addYearcheckrecord(yearcheckrecord);
    }

    @Override
    public int upYearcheckrecord(Yearcheckrecord yearcheckrecord) {
        return yearcheckrecordMapper.upYearcheckrecord(yearcheckrecord);
    }

    @Override
    public boolean removeYearcheckrecord(Integer[] ids) {
        if (ids != null && ids.length > 0 ){
            for (Integer id :ids){
                yearcheckrecordMapper.removeYearcheckrecord(id);
            }
            return true;
        }
        return false;
    }

    @Override
    public Yearcheckrecord selectYearcheckrecordByid(Integer id) {
        return yearcheckrecordMapper.selectYearcheckrecordByid(id);
    }
}
